package jehc.djshi.workflow.service.impl;

import jehc.djshi.common.base.BaseService;
import jehc.djshi.workflow.dao.LcExpDao;
import jehc.djshi.workflow.model.LcExp;
import jehc.djshi.workflow.service.LcExpService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
 * @Desc 流程表达式
 * @Author 邓纯杰
 * @CreateTime 2012-12-12 12:12:12
 */
@Service
public class LcExpServiceImpl extends BaseService implements LcExpService {

    @Resource
    LcExpDao lcExpDao;

    /**
     *
     * @param condition
     * @return
     */
    public List<LcExp> getLcExpListByCondition(Map<String, Object> condition){
        return lcExpDao.getLcExpListByCondition(condition);
    }

    /**
     *
     * @param id
     * @return
     */
    public LcExp getLcExpById(String id){
        return lcExpDao.getLcExpById(id);
    }

    /**
     * 添加
     * @param lcExp
     * @return
     */
    public int addLcExp(LcExp lcExp){
        lcExp.setCreateTime(getDate());
        lcExp.setCreateId(getXtUid());
        lcExp.setId(toUUID());
        return lcExpDao.addLcExp(lcExp);
    }

    /**
     * 修改
     * @param lcExp
     * @return
     */
    public int updateLcExp(LcExp lcExp){
        lcExp.setUpdateId(getXtUid());
        lcExp.setUpdateTime(getDate());
        return lcExpDao.updateLcExp(lcExp);
    }

    /**
     * 删除
     * @param condition
     * @return
     */
    public int delLcExp(Map<String, Object> condition){
        return lcExpDao.delLcExp(condition);
    }
}
